$(document).ready(function() {   
    $(".cartShopInfoContainer").click(function(){
        $(this).hide();
    });
    $(".cartShopInfo").click(function(){
        $(".cartShopInfoContainer").hide();
        $(this).parent().siblings(".cartShopInfoContainer").show();
    });
    $(".productQuantityIncrease, .productQuantityDecrease").click(function() {
        var quantity = new Number($(this).siblings(".productQuantity").val());
        if(quantity.isNaN || quantity.toString() == "NaN" || quantity < 0)
            quantity = new Number(0);
        quantity = quantity.toFixed(0);
        if ($(this).hasClass("productQuantityIncrease"))
            ++quantity;
        else if (quantity > 0)
            --quantity;
        $(this).siblings(".productQuantity").val(quantity);
    });
    $('#s3slider').s3Slider({
        timeOut: 5000
    });
    setInterval( function() {
        var seconds = new Date().getSeconds();
        var sdegree = seconds * 6;
        var srotate = "rotate(" + sdegree + "deg)";
              
        $("#sec").css({
            "-moz-transform" : srotate,
            "-webkit-transform" : srotate
        });
                  
    }, 1000 );  
    setInterval( function() {
        var hours = new Date().getHours();
        var mins = new Date().getMinutes();
        var hdegree = hours * 30 + (mins / 2);
        var hrotate = "rotate(" + hdegree + "deg)";
              
        $("#hour").css({
            "-moz-transform" : hrotate,
            "-webkit-transform" : hrotate
        });
                  
    }, 1000 ); 
    setInterval( function() {
        var mins = new Date().getMinutes();
        var mdegree = mins * 6;
        var mrotate = "rotate(" + mdegree + "deg)";
              
        $("#min").css({
            "-moz-transform" : mrotate,
            "-webkit-transform" : mrotate
        });          
    }, 1000 ); 
    
    
    $(".contactQuestion").click(function () {
        var clicked = $(this);
        if(clicked.parent().find(".contactAnswer").is(":visible")) {
            clicked.removeClass("contactVisible");
            clicked.addClass("contactHidden");
            clicked.parent().find(".contactAnswer").slideUp("slow");
        } else {
            $(".contactAnswer").slideUp("fast");
            $(".contactQuestion").removeClass("contactHidden");
            $(".contactQuestion").addClass("contactHidden");
            clicked.parent().find(".contactAnswer").slideDown("slow");
            clicked.removeClass("contactHidden");
            clicked.addClass("contactVisible");
        }
        
        
    });

    
//    $('#clickme').click(function() {
//  $('#book').slideDown('slow', function() {
//    // Animation complete.
//  });
//});
});